package iss.anxios.dao;

import iss.anxios.dto.ViewGroup;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository("viewgroupdao")
public class ViewGroupDaoImpl implements ViewGroupDao{

	@PersistenceContext
	EntityManager em;
	
	public void SaveViewGroup(ViewGroup viewGroup) {
		em.persist(viewGroup);
	}

	@Transactional
	@SuppressWarnings("unchecked")
	public List<ViewGroup> GetAllViewGroups() {
		return em.createQuery("select view from ViewGroup view").getResultList();
	}

	@Override
	public void remove(ViewGroup viewGroup) {
	}

	@Override
	public ViewGroup GetViewGroupByID(int id) {
		return null;
	}

}
